package ee.falcon.gui.frame.actionlisteners;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import ee.falcon.gui.frame.NewOrEditProfileFrame;
import ee.falcon.gui.frame.ProfilesFrame;

public class MyExitListener extends WindowAdapter
{
	private NewOrEditProfileFrame newOrEditProfile; 
	private ProfilesFrame profile; 
	
	public MyExitListener(NewOrEditProfileFrame newOrEditProfile, ProfilesFrame profile)
	{
		this.newOrEditProfile = newOrEditProfile; 
		this.profile = profile; 
	}
	
	@Override
    public void windowClosing(WindowEvent e) 
    {
    	profile.setEnabled(true); 
		newOrEditProfile.setVisible(false); 
		newOrEditProfile.dispose(); 
    }
}
